package com.googlecode.tda367.denty.core.level;



import java.util.ArrayList;

import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;

import com.googlecode.tda367.denty.core.camera.AutoscrollingCamera;
import com.googlecode.tda367.denty.core.camera.Camera;
import com.googlecode.tda367.denty.core.dynamicbody.ShootingEnemy;

public class FastLevel extends AbstractLevel {
	
	// Keeps track of the viewport
	private Camera camera;
	private String tiledMapPath;
	private TiledMap map;
	
	public FastLevel() {
		this.tiledMapPath = "res/lvl/denty_fastlevel2.tmx";
		try {
			this.map = new TiledMap(this.tiledMapPath);
		} catch(SlickException e) {
			e.printStackTrace();
		}
		this.parseTiledMap(this.map);
				
		this.camera = new AutoscrollingCamera(this.getWidth(), this.getHeight());
		
		ArrayList<ShootingEnemy> enemyList = new ArrayList<ShootingEnemy>();
		enemyList.add(new ShootingEnemy(54f, 47f, this.getWorld()));
		enemyList.add(new ShootingEnemy(85f, 47f, this.getWorld()));
		enemyList.add(new ShootingEnemy(118f, 47f, this.getWorld()));
		enemyList.add(new ShootingEnemy(151f, 47f, this.getWorld()));
		enemyList.add(new ShootingEnemy(284f, 3f, this.getWorld()));
		enemyList.add(new ShootingEnemy(286f, 47f, this.getWorld()));

		for (ShootingEnemy se:enemyList){
			this.addDynamicBody(se);
		}
	}
	

	@Override
	public int getWidth() {
		return this.map.getWidth();
	}
	
	@Override
	public int getHeight() {
		return this.map.getHeight();
	}
	
	@Override
	public Camera getCamera(){
		return this.camera;
	}

	@Override
	public String getTiledMapPath() {
		return this.tiledMapPath;
	}


	@Override
	public int getDentyStartX() {
		return 15;
	}


	@Override
	public int getDentyStartY() {
		return 3;
	}


	@Override
	public int getGoalX() {
		return 295;
	}


	@Override
	public int getGoalY() {
		return 45;
	}


	@Override
	public int getMaxAvailableBlocks() {
		return 50;
	}


	@Override
	public int getBlocksAvailableFromStart() {
		return 5;
	}
	
	@Override
	public void restart(){
		super.restart();
		camera.restart();
	}
}